//
//  NBStorage.m
//  NBExample
//
//  Created by 曹燃 on 15-6-9.
//  Copyright (c) 2015年 feiyu.com. All rights reserved.
//

#import "FYStorage.h"

@implementation FYStorage

+ (void)saveDictionary:(NSDictionary*)dictionary withKey:(NSString*)key {
    if (dictionary == nil) {
        return;
    }
    NSUserDefaults *storage = [NSUserDefaults standardUserDefaults];
    [storage setObject:dictionary forKey:key];
}

+ (NSDictionary*)loadDictionaryWithKey:(NSString*)key {
    NSUserDefaults *storage = [NSUserDefaults standardUserDefaults];
    return [storage objectForKey:key];
}

+ (void)saveArray:(NSArray*)array withKey:(NSString*)key {
    if (array == nil) {
        return;
    }
    NSUserDefaults *storage = [NSUserDefaults standardUserDefaults];
    [storage setObject:array forKey:key];
}

+ (NSArray*)loadArrayWithKey:(NSString*)key {
    NSUserDefaults *storage = [NSUserDefaults standardUserDefaults];
    return [storage objectForKey:key];
}

@end
